﻿using System;
using System.Collections.Generic;

namespace WeiXinSDK.DataModel
{
    public class SubscribeUser : ResultMsg
    {
        /// <summary>
        ///  关注该公众账号的总用户数 
        /// </summary>
        public int total { get; set; }

        /// <summary>
        /// 拉取的OPENID个数，最大值为10000 
        /// </summary>
        public int count { get; set; }

        /// <summary>
        /// 列表数据，OPENID的列表 
        /// </summary>
        public data data { get; set; }

        /// <summary>
        /// 拉取列表的后一个用户的OPENID，（关注者列表已返回完时，返回next_openid为空）
        /// </summary>
        public string next_openid { get; set; }

        /// <summary>
        /// 格式化输出，便于输出调试信息
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            foreach (var item in this.GetType().GetProperties())
            {
                if (item.Name.Equals("Item"))
                {
                    continue;
                }
                sb.AppendFormat("{0}={1},", item.Name, item.GetValue(this, null));
            }
            return sb.ToString().TrimEnd(',');
        }
    }

    public class data
    {
        public List<string> openid { get; set; }
    }
}
